package com.iris.live.services.data.repositories;

import com.iris.live.services.data.models.Lsh保险申请附属Model;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.transaction.annotation.Transactional;

/**
 * Created by hyp on 2016/12/17.
 */
@Transactional
public interface Lsh保险申请附属Repository extends JpaRepository<Lsh保险申请附属Model, Integer>, JpaSpecificationExecutor<Lsh保险申请附属Model> {

    @Query("select a from Lsh保险申请附属Model a where a.初始报价单号=?1")
    Lsh保险申请附属Model findInsByQuote(String quote);

    @Modifying
    @Query("update Lsh保险申请附属Model a set a.状态=?2 where a.初始报价单号=?1")
    void updateStatusByQuote(String quote, String status);

}
